#include<iostream>
using namespace std;

bool isPrime(int num)
{
    if (num < 2) return false;

    for (int i = 2; i * i <= num; i++)
    {
        if (num % i == 0) return false;
    }
    return true;
}

bool nthPrime(int n,int k)
{
    int count = 0;
    int num = 2;
    int a, b,c;
    while (true)
    {
        if (isPrime(num))
        {
            count++;
            if (count == n)
                a = num;
            if (count == n + 1)
            {
                b = num;
                c = b - a;
                break;
            }
        }
        num++;
    }

    if (c == 2 && b<=k) return true;
    return false;
}

int main()
{
    int n;
    int count = 0;
    cin >> n;
    for (int i = 1; i <=n; i++)
    {
        if (nthPrime(i, n))
            count++;
    }
    cout << count << endl;
    return 0;
}